#!/usr/bin/env bash
base_path=~/docker/ELK/filebeat/
container_name=elk-filebeat
script_pwd=$(dirname "$0")

rm -rf $base_path/config
mkdir -p $base_path/config
mkdir -p $base_path/logs
mkdir -p $base_path/data

cp -f $script_pwd/filebeat.yml $base_path/config/.


docker rm -f $container_name

docker run -itd \
-e TZ=Asia/Shanghai \
--name $container_name \
-v $base_path/config/filebeat.yml:/usr/share/filebeat/filebeat.yml \
-v /var/logs:/var/logs \
-v $base_path/logs:/usr/share/filebeat/logs \
-v $base_path/data:/usr/share/filebeat/data \
docker.elastic.co/beats/filebeat:8.16.1
